Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

154 feature request option to dry run #416

Merged
merged 5 commits into from
Apr 26, 2024

Conversation

MatrixCrawler
Copy link
Collaborator

Added --dry-run flag
This will fix #154

@MatrixCrawler MatrixCrawler linked an issue Apr 26, 2024 that may be closed by this pull request
@MatrixCrawler MatrixCrawler added the new feature New feature or request label Apr 26, 2024
@MatrixCrawler
Copy link
Collaborator Author

MatrixCrawler commented Apr 26, 2024

Actually, this feature obsoletes the --show-latest-pre and --show-latest-stable flags as you can you use tfswitch --latest-pre 0.13 --dry-run or tfswitch --latest-stable 0.13 --dry-run 🤔

@MatrixCrawler MatrixCrawler marked this pull request as draft April 26, 2024 08:52
@MatrixCrawler MatrixCrawler marked this pull request as ready for review April 26, 2024 09:12
Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Appreciate your time and effort.

@MatrixCrawler MatrixCrawler merged commit a455c66 into master Apr 26, 2024
3 checks passed
@MatrixCrawler MatrixCrawler deleted the 154-feature-request-option-to-dry-run branch April 26, 2024 11:37
@yermulnik
Copy link
Collaborator

@MatrixCrawler Apologies I haven't shouted earlier:

> git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean

> go run ./main.go --dry-run -u
# no output

> echo $?
0

> go run ./main.go -u
19:37:52.830 INFO Installing terraform at "/home/giermulnik/bin"
19:37:52.875 INFO Switched terraform to version "1.8.2"

Seems like nothing happens with --dry-run. What am I missing? 🤔

@yermulnik
Copy link
Collaborator

Also this but it's probably from something else:

> go run ./main.go --latest-pre 1.7 --dry-run
19:42:43.031 ERROR Error parsing constraint "1.7": <nil>
19:42:43.031 INFO Invalid minor terraform version format.
 Format should be #.# where # are numbers. For example, 0.11 is valid version

> go run ./main.go --latest-pre 1.7
19:41:54.254 INFO Installing terraform at "/home/giermulnik/bin"
19:41:54.336 INFO Downloading "https://releases.hashicorp.com/terraform/1.7.0-rc2/terraform_1.7.0-rc2_linux_amd64.zip"
19:41:54.336 INFO Downloading to "/home/giermulnik/.terraform.versions/terraform_1.7.0-rc2_linux_amd64.zip"
19:41:56.620 INFO 25939409 bytes downloaded
19:41:56.620 INFO Downloading "https://releases.hashicorp.com/terraform/1.7.0-rc2/terraform_1.7.0-rc2_SHA256SUMS"
19:41:56.620 INFO Downloading to "/home/giermulnik/.terraform.versions/terraform_1.7.0-rc2_SHA256SUMS"
19:41:57.343 INFO 1434 bytes downloaded
19:41:57.343 INFO Downloading "https://releases.hashicorp.com/terraform/1.7.0-rc2/terraform_1.7.0-rc2_SHA256SUMS.72D7468F.sig"
19:41:57.343 INFO Downloading to "/home/giermulnik/.terraform.versions/terraform_1.7.0-rc2_SHA256SUMS.72D7468F.sig"
19:41:57.420 INFO 566 bytes downloaded
19:41:57.420 INFO Verifying signature of checksum file...
19:41:57.427 INFO Checksum file signature verification successful.
19:41:57.485 INFO Deleting "/home/giermulnik/.terraform.versions/terraform_1.7.0-rc2_SHA256SUMS"
19:41:57.485 INFO Deleting "/home/giermulnik/.terraform.versions/terraform_1.7.0-rc2_SHA256SUMS.72D7468F.sig"
19:41:57.901 INFO Switched terraform to version "1.7.0-rc2"
19:41:57.901 ERROR Error parsing constraint "1.7": <nil>
19:41:57.901 INFO Invalid minor terraform version format.
 Format should be #.# where # are numbers. For example, 0.11 is valid version

The errors looks odd 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
2 participants